package com.tian.controller.management;

import com.tian.common.CommonResult;
import com.tian.dto.coupon.CouponUsedStatisticsRespDto;
import com.tian.service.CouponUsedStatisticsService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * {@code @description:} 统计优惠券使用情况的控制器
 *
 * @author tianwc 公众号：Java后端技术全栈
 * 在线刷题 1200+java面试题和1000+篇技术文章：<a href="https://woaijava.cc/">博客地址</a>
 * {@code @date:} 2024-10-26 17:53
 * {@code @version:} 1.0
 */
@RestController
@RequestMapping("/management/coupon/statistics")
@Api(tags = "优惠券使用统计 控制器")
public class CouponUsedStatisticsController {

    @Resource
    private CouponUsedStatisticsService couponUsedStatisticsService;

    @GetMapping("/{couponId}")
    public CommonResult<CouponUsedStatisticsRespDto> getCouponUsedStatistics(@PathVariable("couponId") Integer couponId) {
        return couponUsedStatisticsService.getCouponUsedStatistics(couponId);
    }
}
